mod model;
mod render;
use crate::{model::RedBlackModel, render::RedBlackRender};
use log::info;
use std::error::Error;
use tge::game::Game;
use tge::log::init_log;

fn main() -> Result<(), Box<dyn Error>> {
    init_log(log::LevelFilter::Info, "log/redblack.log");
    info!("RedBlack(tge.rs) start...");
    let mut m = RedBlackModel::new();
    let mut r = RedBlackRender::new();
    let mut g = Game::new(&mut m, &mut r);
    g.init();
    g.run()?;
    g.render.term.reset(&mut g.context);
    Ok(())
}
